package com.server;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * 服务端，启动类
 */
public class ServerMain {
    public static void main(String[] args) throws IOException {
        // 创建ServerSocket对象，并指定端口号
        ServerSocket serverSocket = new ServerSocket(8989);
        System.out.println("服务端已启动，端口：8989");
        // 等待客户端连接
        Socket accept = serverSocket.accept();
        System.out.println("客户端连接成功。。。");
    }
}